package com.D5Power.Editor.EditorWindow
{
	import flash.events.Event;
	
	import org.aswing.FlowLayout;
	import org.aswing.JButton;
	import org.aswing.JFrame;
	import org.aswing.JPanel;
	import org.aswing.ext.Form;
	
	/**
	 * 地图编辑器基本窗口
	 */ 
	public class D5EditorWin extends JFrame
	{
		/**
		 * 属性窗的标题
		 */ 
		protected var mytitle:String;
		/**
		 * 表单容器
		 */ 
		protected var _box:Form;
		/**
		 * 间距
		 */ 
		protected var _padding:uint=5;
		/**
		 * 主程序的引用
		 */ 
		protected var _root:MapEditor;

		
		public function D5EditorWin(owner:MapEditor)
		{
			_root = owner;
			super(_root.Window, mytitle, false);
			init();
		}
		/**
		 * 初始化程序
		 */ 
		protected function init():void
		{
			initEnd();
		}
		
		protected function onCancle(e:Event):void
		{
			closeReleased();
		}
		
		protected function onSubmit(e:Event):void
		{
			closeReleased();
		}

		/**
		 * 结束初始化
		 */ 
		protected function initEnd():void
		{
			var bt_ok:JButton = new JButton('确认');
			var bt_cancle:JButton = new JButton('取消');

			bt_cancle.addActionListener(onCancle);
			bt_ok.addActionListener(onSubmit);
			
			var jpanle:JPanel = new JPanel(new FlowLayout(FlowLayout.CENTER,16,5));
			jpanle.appendAll(bt_ok,bt_cancle);
			_box.append(jpanle);
			
			setSizeWH(_box.width+_padding*2,_box.height+_padding*2);
			setLocationXY(730,150);
		}
	}
}